package com.yzjs.enumeration;


import com.yzjs.base.BestPayException;

public enum BestPayTypeEnum {
    WXPAY_MP("JSAPI", BestPayPlatformEnum.WX, "微信公众账号支付"),
    WXPAY_MWEB("MWEB", BestPayPlatformEnum.WX, "微信H5支付"),
    WXPAY_NATIVE("NATIVE", BestPayPlatformEnum.WX, "微信Native支付"),
    WXPAY_MINI("JSAPI", BestPayPlatformEnum.WX, "微信小程序支付"),
    WXPAY_APP("APP", BestPayPlatformEnum.WX, "微信APP支付");

    private String code;
    private BestPayPlatformEnum platform;
    private String desc;

    private BestPayTypeEnum(String code, BestPayPlatformEnum platform, String desc) {
        this.code = code;
        this.platform = platform;
        this.desc = desc;
    }

    public String getCode() {
        return this.code;
    }

    public BestPayPlatformEnum getPlatform() {
        return this.platform;
    }

    public String getDesc() {
        return this.desc;
    }

    public static BestPayTypeEnum getByName(String code) {
        BestPayTypeEnum[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            BestPayTypeEnum bestPayTypeEnum = var1[var3];
            if (bestPayTypeEnum.name().equalsIgnoreCase(code)) {
                return bestPayTypeEnum;
            }
        }

        throw new BestPayException(BestPayResultEnum.PAY_TYPE_ERROR);
    }
}

